home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 64 / Mac Magazin CD 64.iso / Updates / FileMaker Pro Server / Web Companion / Web Companion.rsrc / HDAT_23221_FMP-IWPErr.js < prev    next >
Encoding:
JavaScript  |  1999-09-08  |  1.9 KB  |  94 lines

  1. /*
  2.     FMP-IWPErr.js
  3.     
  4.     (c) Copyright 1999 FileMaker, Inc. All rights reserved.
  5.     
  6.     Modification History:
  7.     3/5/99 KJJ    Created.
  8. */
  9.  
  10. /* Err Object Definition */
  11.  
  12. function display_error()
  13. {
  14.     alert(this.title + this.cn + this.cr2 + this.mssg);
  15.     if ( location.href.toLowerCase().indexOf(this.fmres) > -1 )
  16.     {
  17.         if ( this.where == "" )
  18.             history.back();
  19.         else
  20.         {
  21.             if ( this.where != "stop" )
  22.             {
  23.                 this.where = this.local(this.where);
  24.                 window.location = this.where;
  25.             }
  26.         }
  27.     }
  28.     else
  29.         history.back();
  30. }
  31.  
  32. function insert_lang(str)
  33. {
  34.     var result = "";
  35.     
  36.     if ( str.indexOf(this.delim) > -1 )
  37.     {
  38.         segments = str.split(this.delim);
  39.         if ( segments[0] != "" )
  40.             result = segments[0];
  41.         result += this.getlang() + segments[1] + this.getstyle() + segments[2];
  42.     }
  43.     else
  44.         result = str;
  45.     return result;
  46. }
  47.  
  48. function get_lang()
  49. {
  50.     if ( this.lang == null )
  51.         this.lang = this.vformat.substring(0,1);
  52.     return this.lang;
  53. }
  54.  
  55. function get_style()
  56. {
  57.     if ( this.style == null )
  58.     {
  59.         this.style = this.dot;
  60.         if ( this.vformat.indexOf(this.css) != -1 )
  61.             this.style = this.css;
  62.         if ( this.vformat.indexOf(this.txt) != -1 )
  63.             this.style = this.txt;
  64.     }
  65.     return this.style;
  66. }
  67.  
  68. function IWPErr()
  69. {
  70.     this.display    =    display_error;
  71.     this.local        =    insert_lang;
  72.     this.getlang    =    get_lang;
  73.     this.getstyle    =    get_style;
  74.     this.english    =    "Z";
  75.     this.eFormat    =    "-format=";
  76.     this.where        =    "";
  77.     this.delim        =    "~";
  78.     this.fmres        =    "/fmres/";
  79.     this.cr2        =    "\r\r";
  80.     this.cn            =    ":";
  81.     this.css        =    "css.";
  82.     this.txt        =    "txt.";
  83.     this.dot        =    ".";
  84.     this.amp        =    "&";
  85.     this.title        =    "Unexpected Error";
  86.     this.mssg        =    "Unable to process your request because the server encountered an\n" +
  87.                         "unexpected condition.  For more detail on error number \"[FMP-CurrentError]\",\n" +
  88.                         "refer to the FileMaker Help topic \"Status (CurrentError)\" and\n" +
  89.                         "contact your site administrator.";
  90. }
  91. /* Create Objects */
  92.  
  93. err = new IWPErr();
  94.